home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / fontconfig.preinst < prev    next >
Text File  |  2009-03-19  |  1KB  |  48 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. # Prepare to move a conffile without triggering a dpkg question
  6. prep_mv_conffile() {
  7.     CONFFILE="$1"
  8.  
  9.     if [ -e "$CONFFILE" ]; then
  10.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.         old_md5sum="`dpkg-query -W -f='${Conffiles}' | sed -n -e \"{\\\\' $CONFFILE'{s/.* //;p}}\"`"
  12.         if [ "$md5sum" = "$old_md5sum" ]; then
  13.             rm -f "$CONFFILE"
  14.         fi
  15.     fi
  16. }
  17.  
  18. FILES="\
  19. /etc/fonts/fonts.conf \
  20. /etc/fonts/fonts.dtd \
  21. /etc/fonts/conf.d/autohint.conf \
  22. /etc/fonts/conf.d/no-bitmaps.conf \
  23. /etc/fonts/conf.d/no-sub-pixel.conf \
  24. /etc/fonts/conf.d/sub-pixel.conf \
  25. /etc/fonts/conf.d/unhinted.conf \
  26. /etc/fonts/conf.d/yes-bitmaps.conf"
  27.  
  28. #
  29. # This marks when the config files moved from this package
  30. # to the fontconfig-config package
  31. #
  32. NEWVERSION=2.3.2-2
  33.  
  34. case "$1" in
  35. install|upgrade)
  36.   if [ -n "$2" ] && dpkg --compare-versions "$2" lt "$NEWVERSION"; then
  37.     for FILE in $FILES; do
  38.       prep_mv_conffile $FILE
  39.     done
  40.   fi
  41. esac
  42.  
  43. # doc dir is now a symlink to fontconfig
  44. if [ "$1" = upgrade ] && [ ! -L /usr/share/doc/fontconfig ]; then
  45.     rm -rf /usr/share/doc/fontconfig
  46. fi
  47.  
  48.